<?php
/**
 * @author all@cosmos-framework.org
 * @copyright (c) 2013 cosmos-framework.org
 * @license http://www.opensource.org/licenses/mit-license.php
 * @link http://cosmos-framework.org/
 * @package cosmos.framework
 * @version 2.0
 */
namespace Cosmos\Database;

use \Cosmos\Database;
use \Cosmos\Invoker;

class Tx extends Invoker {

    /**
     * @param string $methodName
     * @param mixed[] $methodArgs
     * @return mixed
     */
    public function __call($methodName, $methodArgs) {

        $f = function() use ($methodName, $methodArgs) {
            return parent::__call($methodName, $methodArgs);
        };

        $d = &$this->componentArgs[0];
        $s = &$this->componentArgs[1];

        return Database::pcommit($d, $f, $s);
    }

}
